<?php
$startTime = microtime(TRUE);
$con = mysqli_connect("db15.freehost.com.ua","zvit_root","openac1948","zvit_other");
mysqli_set_charset($con, "utf8");
if (mysqli_connect_errno()) {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}


$i=0;
while(isset($_POST['Id'.$i])){
	$Id = mysqli_real_escape_string($con,$_POST['Id'.$i]);
	$Nick = mysqli_real_escape_string($con, $_POST['Nick'.$i] );
	$Password = mysqli_real_escape_string($con, $_POST['Password'.$i] );
	$sql = "INSERT INTO User (Id, Nick, Password) VALUES ($Id,'$Nick','$Password');";
	if (!mysqli_query($con,$sql)) {
	  die('Error: ' . mysqli_error($con));
	}
	echo $sql.'<br/>';
	$i++;
}		
	mysqli_close($con);
	echo "Processed $i INSERT query(ies) " .(microtime(TRUE) - $startTime)."sec <br/>";	
?> 
